package com.apesource.bookBuy.conf;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "9021000151671055";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCMacdHxruOiIZeeQ8/zDB4tsua0NUIti1wEzKSLgEgA3n3TEDD4q39tdTND6vWa1/xGpRThJXOs0zIxAFxCP6HCNbtgUZIW55lxgk7cV5NtGhLVsZFWa/M3sMNi7WP2wdmbJa2D8AaNrk+zf7l2qyC3M1OinobbsJgor2HpoDZgvHjJhtuERBw0OTVBkhl3wWZhxb6k8J+O3pAwW3OkiN/xOvcjLCROn/QyO9a5ouwqi4j2NzgamdUMt5SwAEfWalxdSr1Y/dUWsLl9EWJbrMKv/Wf22LhW9Gs4gAhlpLr274owD8aGER+ArGfW4QcjozhnOcJPZmFfHkIKTpLx3xpAgMBAAECggEAejvre5SJ2j8Hml6Q490BpVScUp3Rls/hJlvP/mmGGTRtjNcY2m4PQXp1Uj5+PR8kWmPlE/+r2lFEWtIm3xwRV8ReNkv/vyXi8n4/szux+LtAv7U+zUiSPir+amBhImZuPr/xQ3TaqvdQtFfnunlvDEzjfagXPKJjHHUPwXM1YCPL/brHHGsIavrxAJZLj9uFVw6C8CCSTQMqR28dfejFvFuOhf5peM0Wa9Idgo15TZmyPcVnqnPLj0zRyPSqRJW2DMcAiqWqWbZY6IqLNmlw570WTdfovNY8+GHsRiur90bqXDucpAY7y1SZ8kJqdiUY2ZyKRuZvANLkvteKOp77wQKBgQDdwsemRLwfL/lJX2QH32LnJHTHV1PBvirXRkIS4/Z0vRoH4CzH6PVu6aBM2sMIxU8eX+53m/zwMwkl4HlUXBJm6nwOExCFGye9fpy4NBJXSgfvfKwd9hT36ycZkxzVe6exbtu3LvJknBxFq/rKYLu0NJG4aLKr8q4h7PkS9UpuPQKBgQCiF6/55P36XLODSPHxYWzbetDTbAZJmKS3GugCSC6A184cUcBrpjZQ2XrC5Qgxwp303OI0YElBDf4CzJmeWDKNqqZrAbVC4MODVeqbBh1zrEQ6keY1A2d5EvzywtmA+XFfXXLpqvyqXu2GCPfihzfrS1yLGbpgGz4G54NSh8B1nQKBgQClKS5czRB3AdneJadwnZUhpWs8E/QTdbiegHsxaorhwv0iJHn1obE5m9KBquRbIeidLMGEX67wjnIfvaFfjPs/nyAps1U4bVMZtLSwFEgcrsxeNzJRVjejtYV3bLOq49+vLGuDcPmiqQn9cerk00q5GfX1rDR2D9ZU+hM/ZWS72QKBgQCfyPH0SUQEdTWQiWvXIs8IXL1WbPqVuh9FUQS8myMcZ6AKUpx4gdSxRnG5hcTaKJtFMijasMAFnSF06PPWH+NVu49plLl2P9L7uMoYH6MQ0BRCGGjygXSS6aDoPiPi/AJCnAAXUDLaT9Gde2HAsMLy88s6ZBZRfwlaDQZraN7UEQKBgEsYGcRDQLo4rXDPUwU/UM2KhymElbRajznG4wgfZuugEicl3x4Uk105NErNogiGeNsQw2UotR1kcMEbz1DS1/zgN/DiCZDm6JsuAF9pIcFEa6S/4XTjEmfRmTsXtATxYwv6pt+XOp3fCOjcjjHpDIYStCU8eEr4sn/b4hNQ3dmK";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv6zPIMEa88hSTYtrKnC2FLB0B8/WEQtuYWsBS/fFExk2DjBzOblnfXx246PzIEXrWYMKwTnqIjeQNOzcfxLRLNRRgEpVpSREJdPLzS6CpRXsL43HrTcgH0blDx2igi39pNwOtPd5TWdd3MD1BAGoyrY5k9KHw9PbCLFp949lVhbAhHnsLpZTPST37Kxu6XApvSUVtIxYeP8rHEiLmJChsb4T4pImmR4Cn5OonM7INsEI16BaAVsHg/lULByH5Kz7uzUeXrpF5vRpD7ONNdJGFih4oF3ygLIlivFLQppCakBZf19uk7aNQSVLfTeako/V1mc8ReJcut7zr3Xs6JrWfQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost/aliretrun";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost/aliretrun";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

